/**
 * MCP团队接口
 */
const mcpTeamedApi = {
    /**
     * 团队成员搜索
     *
     * @param params
     * @param {string} params.ap_code MCP编号
     * @param {string} params.keyword 搜索关键字
     * @returns {Promise<TeamedUserResponse[]>}
     * @author zero
     */
    find_user(params: {
        ap_code: string;
        keyword: string;
    }): Promise<TeamedUserResponse[]> {
        return $request.get<TeamedUserResponse[]>({
            url: '/agent/mcp/teamed/find_user',
            params
        }, {
            isTransformResponse: false
        })
    },

    /**
     * 团队成员列表
     *
     * @param params
     * @param {string} params.ap_code MCP编号
     * @returns {Promise<TeamedMemberResponse[]>}
     * @author zero
     */
    lists(params: {
        ap_code: string;
    }): Promise<TeamedMemberResponse[]> {
        return $request.get<TeamedMemberResponse[]>({
            url: '/agent/mcp/teamed/lists',
            params
        })
    },

    /**
     * 团队成员添加
     *
     * @param params
     * @param {string} params.bot MCP编号
     * @param {string} params.user_sn 用户编号
     * @param {number} params.power 权限值: [1=普通成员, 2=管理员, 3=所有者]
     * @returns {Promise<any>}
     * @author zero
     */
    add(params: {
        ap_code: string;
        user_sn: string;
        power: number;
    }): Promise<any> {
        return $request.post({
            url: '/agent/mcp/teamed/add',
            params
        })
    },

    /**
     * 团队成员编辑
     *
     * @param params
     * @param {number} params.id 成员ID
     * @param {number} params.power 权限值: [1=普通成员, 2=管理员, 3=所有者]
     * @returns {Promise<any>}
     * @author zero
     */
    edit(params: {
        id: number;
        power: number;
    }): Promise<any> {
        return $request.post({
            url: '/agent/mcp/teamed/edit',
            params
        })
    },

    /**
     * 团队成员删除
     *
     * @param {number} id 成员ID
     * @returns {Promise<any>}
     * @author zero
     */
    delete(id: number): Promise<any> {
        return $request.post({
            url: '/agent/mcp/teamed/delete',
            params: { id }
        })
    },
}

export default mcpTeamedApi
